<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
</h:head>

<h:body>
	<p:scrollPanel mode="native" style="width:100%;height:100%;">
		<h:form id="form">
			<p:growl id="growl" life="3000" />
			<p:dataTable id="tblServicosFaces" var="face"
				value="#{facequadraBean.facesquadra}" paginator="true" rows="10"
				rowsPerPageTemplate="5,10,15" style="margin-bottom:20px"
				emptyMessage="Nenhuma face de quadra cadastrada." editable="true">

				<p:ajax event="rowEdit" listener="#{facequadraBean.onRowEdit}"
					update=":form:growl" />
				<p:ajax event="rowEditCancel"
					listener="#{facequadraBean.onRowCancel}" update=":form:growl" />

				<f:facet name="header">
	       		 	Serviços de faces de quadra
	    		</f:facet>

				<p:column headerText="Número" filterBy="#{face.numeroFacequadra}"
					filterMatchMode="contains">
					<h:outputText value="#{face.numeroFacequadra}" />
				</p:column>

				<p:column headerText="Rede de água">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{face.textoRedeAgua}" />
						</f:facet>
						<f:facet name="input">
							<p:selectBooleanButton value="#{face.redeAgua}" onLabel="Sim"
								offLabel="Não" onIcon="ui-icon-check" offIcon="ui-icon-close"
								style="width:70px" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Rede telefônica">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{face.textoRedeTelefonica}" />
						</f:facet>
						<f:facet name="input">
							<p:selectBooleanButton value="#{face.redeTelefonica}"
								onLabel="Sim" offLabel="Não" onIcon="ui-icon-check"
								offIcon="ui-icon-close" style="width:70px" />
						</f:facet>
					</p:cellEditor>
				</p:column>


				<p:column headerText="Rede elétrica">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{face.textoRedeEletrica}" />
						</f:facet>
						<f:facet name="input">
							<p:selectBooleanButton value="#{face.redeEletrica}" onLabel="Sim"
								offLabel="Não" onIcon="ui-icon-check" offIcon="ui-icon-close"
								style="width:70px" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Rede de esgoto">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{face.textoRedeEsgoto}" />
						</f:facet>
						<f:facet name="input">
							<p:selectBooleanButton value="#{face.redeEsgoto}" onLabel="Sim"
								offLabel="Não" onIcon="ui-icon-check" offIcon="ui-icon-close"
								style="width:70px" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Emplacamento">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{face.textoEmplacamento}" />
						</f:facet>
						<f:facet name="input">
							<p:selectBooleanButton value="#{face.emplacamento}" onLabel="Sim"
								offLabel="Não" onIcon="ui-icon-check" offIcon="ui-icon-close"
								style="width:70px" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Arborização">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{face.textoArborizacao}" />
						</f:facet>
						<f:facet name="input">
							<p:selectBooleanButton value="#{face.arborizacao}" onLabel="Sim"
								offLabel="Não" onIcon="ui-icon-check" offIcon="ui-icon-close"
								style="width:70px" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Sarjetas">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{face.textoSarjetas}" />
						</f:facet>
						<f:facet name="input">
							<p:selectBooleanButton value="#{face.sarjetas}" onLabel="Sim"
								offLabel="Não" onIcon="ui-icon-check" offIcon="ui-icon-close"
								style="width:70px" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Galerias pluviais">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{face.textoGaleriasPluviais}" />
						</f:facet>
						<f:facet name="input">
							<p:selectBooleanButton value="#{face.galeriasPluviais}"
								onLabel="Sim" offLabel="Não" onIcon="ui-icon-check"
								offIcon="ui-icon-close" style="width:70px" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Iluminação">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{face.textoIluminacao}" />
						</f:facet>
						<f:facet name="input">
							<p:selectBooleanButton value="#{face.iluminacao}" onLabel="Sim"
								offLabel="Não" onIcon="ui-icon-check" offIcon="ui-icon-close"
								style="width:70px" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Coleta de lixo">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{face.textoColetaLixo}" />
						</f:facet>
						<f:facet name="input">
							<p:selectBooleanButton value="#{face.coletaLixo}" onLabel="Sim"
								offLabel="Não" onIcon="ui-icon-check" offIcon="ui-icon-close"
								style="width:70px" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Limpeza">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{face.textoLimpeza}" />
						</f:facet>
						<f:facet name="input">
							<p:selectBooleanButton value="#{face.limpeza}" onLabel="Sim"
								offLabel="Não" onIcon="ui-icon-check" offIcon="ui-icon-close"
								style="width:70px" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Pavimentação">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{face.pavimentacao}" />
						</f:facet>
						<f:facet name="input">
							<p:selectOneMenu value="#{face.pavimentacao}">
								<f:selectItem itemLabel="Sem pavimentação" itemValue="SEM" />
								<f:selectItem itemLabel="Asfalto" itemValue="ASFALTO" />
								<f:selectItem itemLabel="Paralelepipedo"
									itemValue="PARALELEPIPEDO" />
								<f:selectItem itemLabel="Concreto" itemValue="CONCRETO" />
								<f:selectItem itemLabel="Poliedro" itemValue="PROLIEDRO" />
								<f:selectItem itemLabel="Escadaria" itemValue="ESCADARIA" />
								<f:selectItem itemLabel="Outros" itemValue="OUTROS" />
							</p:selectOneMenu>
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column width="1%">
					<p:rowEditor />
				</p:column>

			</p:dataTable>

			<h3>Exportar</h3>
			<h:commandLink>
				<p:graphicImage url="imagens/excel.png" width="24" />
				<p:dataExporter type="xls" target="tblServicosFaces"
					fileName="faces" pageOnly="true" />
			</h:commandLink>

			<h:commandLink>
				<p:graphicImage url="imagens/pdf.png" width="24" />
				<p:dataExporter type="pdf" target="tblServicosFaces"
					fileName="faces" pageOnly="true" />
			</h:commandLink>
		</h:form>
	</p:scrollPanel>
</h:body>
</html>